<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <div align="center">
            <h:form>
                <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true"/>
            </h:form>
            
            <f:view>
                <h:form>
                    <p:panelGrid columns="2" >
                        <f:facet name="header">
                            Cadastro de Serviços
                        </f:facet>
                        <h:outputText value="Id"/>
                        <p:inputText size="1" id="idServico" value="#{controleServico.servico.idServico}"/>
                           
                        <h:outputText value="Descrição"/>
                        <p:inputText id="descricaoServico" size="50" required="true" requiredMessage="Informe a descrição do serviço" value="#{controleServico.servico.descricaoServico}"/>

                        <h:outputText value="Preço"/>
                        <p:inputText size="10" id="precoServico" value="#{controleServico.servico.preco}"/>

                        <f:facet name="footer">
                            <p:commandButton value="Salvar" action="#{controleServico.salvar()}" actionListener="#{mensagem.mensagemSimples(actionEvent)}"/>
                            <!-- <p:commandButton id="sal" value="Salvar" action="#{controleServico.salvar()}" onclick="PF('dlg1').show();"/> -->
                            <p:commandButton value="Limpar" type="reset" action="#{controleServico.limparServico()}"/>
                            <p:commandButton value="Listar" action="#{controleServico.voltar()}"/>
                            <p:commandButton value="Home" action="#{controleServico.home()}"/>
                        </f:facet>

                    </p:panelGrid>    
                    <!-- <p:dialog id="salva" header="Confirmação" modal="true" widgetVar="dlg1">
                        <h:outputText value="Registro Salvo"/>
                    </p:dialog> -->
                </h:form>    
            </f:view>
        </div>
    </h:body>
</html>

